<?php
/**
 * Description of Login
 *
 * @author a.i.
 */

class Form_Login extends Zend_Form {

    private $_options = null;

    public function  __construct($options = null) {
        $this->_options  = $options;
        parent::__construct($options);
    }

    public function  init() {
        parent::init();

        $this->setMethod('POST');

        $email = new Zend_Form_Element_Text('email');
        $email->setRequired(true)
                ->setValidators(array('EmailAddress'))
                ->setFilters(array('StringTrim', 'StringToLower', 'StripTags'))
                ->setLabel(_('Email'))
                ->setDecorators(array('ViewHelper'));

        $password = new Zend_Form_Element_Password('password');
        $password->setRequired(true)
                ->setFilters(array('StringTrim'))
                ->setLabel(_('Password'))
                ->setDecorators(array('ViewHelper'));

        $remember = new Zend_Form_Element_Checkbox('remember_me');
        $remember->setValue(1)
                ->setDecorators(array('ViewHelper'))
                ->setLabel(_('Remember me'));

        

            $submit = new Zend_Form_Element_Submit('SignIn');
            $submit->setDecorators(array('ViewHelper'))
                    ->setLabel(_('Смело войти'));

            $this->addElement($submit);
        

        $this->addElements(array(
            $email,
            $password,
            $remember
        ));

        $this->setDecorators(
                array(
                    array('ViewScript', array('viewScript' => 'register/forms/login.phtml'))
                    ));

    }

}